import pose_recognition as pr

"""
算法的启动代码，如果通过app.py文件驱动，调用的是startcode()函数
直接运行此文件的话，调用的是main()函数

如果直接在本文件驱动，先修改main()函数的视频路径
"""


def startcode(videoInput, sideInput, heightInput):
    video_path = videoInput  # 替换为你的视频路径
    # video_path = "video\\right_Ready position.mp4"
    # video_path = "video\\right2.mp4"
    side = sideInput
    height_real = heightInput


    detector = pr.PoseDetector(video_path,height_real,side)
    # 启动动画
    detector.start_animation()
    try:
        detector.__del__()
    except Exception:
        detector.__del__()

def main():
    video_path = "video\Pixel_Low.mp4"  # 替换为你的视频路径

    side = int(input("选择需要识别的人(左边的人=1，右边的人=2，单人视频=0)"))
    height_real = int(input("请输入真实身高"))


    detector = pr.PoseDetector(video_path,height_real,side)
    # 启动动画
    detector.start_animation()
    try:
        detector.__del__()
        print("运行完成")
    except Exception:
        detector.__del__()
        print("运行完成")


if __name__ == '__main__':
    main()
        